$.ajax({
    url: '/api/order_month_paynum_data',
    type: 'get',
    success: function (resp) {
        month = resp.month
        num_data = resp.num_data

        var chartDom = document.querySelector('#bar')
        var myChart = echarts.init(chartDom);
        var option;

        option = {
            title: {
                text: "每月的交易量",
                subtext: '2019年',
                left: 'center',
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [
                {
                    type: 'category',
                    data: month,
                    axisTick: {
                        alignWithLabel: true
                    }
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: '交易量',
                    type: 'bar',
                    barWidth: '60%',
                    data: num_data
                }
            ]
        };

        option && myChart.setOption(option);
    }
})



